1. Field of the Invention
The present invention relates to wear leveling methods for non-volatile memory devices, and more particularly, to a method of performing wear leveling that employs a variable threshold.
2. Description of the Prior Art
Non-volatile memory it typically organized in units of erasable blocks. Before performing a writing operation on a block, the block must first be erased before the block may be written to. However, a number of times each block may be erased is not infinite, but has an upper limit. Thus, products that utilize the non-volatile memory as a storage medium may employ a “wear leveling” mechanism to ensure that the number of erase operations performed does not differ too drastically across all blocks of the memory. However, wear leveling also requires moving data from frequently erased blocks to less erased blocks, which takes up erase count, and also lowers system performance.
Please refer to FIGS. 1 and 2, which is are diagrams illustrating non-volatile memory blocks/banks without wear leveling (FIG. 1) and with wear leveling (FIG. 2). Wear leveling mechanisms are aimed at distributing erase operations evenly over all blocks of a non-volatile memory, so as to extend life of the non-volatile memory (and thus an electronic device using the non-volatile memory) by increasing length of time it takes for a block that has been erased the most times to reach the upper limit on number of erase operations performed. In practice, information on how many times each block has been erased may be stored. Or, the blocks may be grouped into banks, each bank comprising multiple blocks, and average number of erase operations performed or total erase operations performed for each bank may be stored. In other words, each bank may comprise an arbitrary number of blocks. Wear leveling, then, may be triggered when a difference (Delta) of a greatest number of erase operations and a least number of erase operations exceeds a threshold. Or, wear leveling may be triggered once every certain number Wth of write operations performed. When the wear leveling mechanism is activated, data from blocks with relatively high erase count may be exchanged with data from blocks with relatively low erase count, so as to reduce the difference Delta between the block(s)/bank(s) with the highest erase count and the block(s)/bank(s) with the lowest erase count.
Regardless of how the wear leveling mechanism is activated, the non-volatile memory utilizing the wear leveling mechanism described above may effectively reduce the difference of the block(s)/bank(s) with the highest erase count and the block(s)/bank(s) with the lowest erase count to within a wear leveling limit WLDelta, as shown in FIG. 2. By increasing how often data is exchanged between the blocks/banks with high erase count and the blocks with low erase count, the wear leveling limit WLDelta may be made even tighter. Frequency exchange of data, however, reduced transmission performance. Even more important, each exchange of data represents an increase in overall erase count, which reduces product lifetime.